<template>
	<div class="add-brand-box">
		<h3 style="margin-top: 0;">{{ title }}</h3>
		<p style="margin-top: 0;">品牌图片:</p>
		<global-upload  :isIdcard="false" :isCreateShop="true" 
			@imageUpload="businessLicenseUploadFn" @imageRemove="businessLicenseRemoveFn"
			:initOne="languageInfo.img_url" :isHeadImg="true">
		</global-upload>
		<p>品牌名称:</p>
		<el-input v-model="languageInfo.name" @change="sendParamsFn" placeholder="请输入品牌名称" style=""></el-input>
	</div>
</template>
<script>
import GlobalUpload from '@/components/GlobalUpload';
export default {
	components: { GlobalUpload },
	data() {
		return {
			languageInfo:{},
		};
	},
	props:{
		title:{
			type:String,
			default:''
		},
		type:{
			type:String,
			default:''
		},
		initData:{
			type:Object,
			default:()=>{}
		}
	},
	created(){
		
		this.languageInfo =_.cloneDeep(this.initData);
	},
	methods: {
		businessLicenseUploadFn(file) {
			this.languageInfo.img_url = file.url;
			this.sendParamsFn();
		},
		businessLicenseRemoveFn() {
			this.languageInfo.img_url = '';
			this.sendParamsFn();
		},
		sendParamsFn(){
			this.$emit('checkCondition',this.languageInfo);
		}
	}
};
</script>
<style lang="scss" scoped>
.add-brand-box{
	box-sizing: border-box;
	padding: 20px;
	background: #f9f9f9;
	margin-top: 20px;
	border-radius: 10px;
 }
</style>